<?php
session_start();

require '../module/PHPlot.class.php';

 if(isset($_GET['view']) && $_GET['view']=='users'){


$data = unserialize($_SESSION['prova']);

$graph = new PHPlot(800, 600);
$graph->SetImageBorderType('plain');

$graph->SetPlotType('lines');
$graph->SetDataType('text-data');
$graph->SetDataValues($data);
$graph->SetYTickIncrement(1);
$graph->SetTitle('Statistiche relative alle iscrizioni');

$graph->SetPlotAreaWorld(NULL, 0, NULL, NULL);

$graph->DrawGraph();

}else if(isset($_GET['view']) && $_GET['view']=='cat'){
    
    $data = unserialize($_SESSION['cat_stats']);



    $graph = new PHPlot(800, 600);

    $graph->SetDataType("text-data");  //Must be called before SetDataValues

    $graph->SetDataValues($data);

    $graph->SetXTitle("");
    $graph->SetYTitle("Verbal Cues");
    $graph->SetYTickIncrement(1);
    $graph->SetPlotType("bars");
    $graph->SetXTickPos('none');
    $graph->SetXLabelAngle(0);  //have to re-set as defined above
    $graph->SetTitle('Statistiche relative alle categorie');
    $graph->SetDataColors(array('green', 'yellow', 'red'));
    
    $graph->DrawGraph();
}




?>
